#include <string.h>
#include <stdio.h>

int main(int argc, char const *argv[])
{
    char strBuffer[] = { "Hello World China No Fear in My Heart" };
    char *pStrSeg[20] = {0};

    pStrSeg[0] = strtok( strBuffer, " ");
    int i=1;
    while ( ( pStrSeg[i] = strtok( NULL, " ") ) != NULL )
    {
        i++;
    }
    
    i=0;
    while( pStrSeg[i] != NULL )
    {
        printf( "Seg# %d : %s\n", i, pStrSeg[i] );
        i++;
    }
    
    return 0;
}

/*
strtok的用法
while循环的写法
*/